package com.yuninglong.serverb;

import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author yuninglong
 */

@Log4j2
@RestController
@RequestMapping("test")
public class TestController {


    @Autowired
    private RestTemplate restTemplate;

    @GetMapping(value = "/echo")
    public String echo() {
        String getInfo = restTemplate.getForObject("http://server/config/get/", String.class);
        log.info("getInfo-------------" + getInfo);
        return getInfo;
    }
}
